home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d27
/
moot.arc
/
MOOT.DOC
< prev
next >
Wrap
Text File
|
1990-12-31
|
15KB
|
395 lines
Multiple Boot (Moot) Utilities
by
Eric Tauck
1304 Deerpass Road
Marengo, IL 60152
Compuserve: 72457,1557
Internet: 72457.1557@compuserve.com
The Moot Utilities are a collection of device drivers and programs for
implementing multiple DOS boot configurations using single CONFIG.SYS
and AUTOEXEC.BAT files. The device drivers CHOOSE, LOAD, and SKIP
allow specific lines of the CONFIG.SYS file to be processed or
ignored. The programs MOOT.COM and INPUT.COM perform similar
functions for batch files. Additionally, the device drivers CLEAR,
MOVE, and ECHO perform display functions from the CONFIG.SYS file.
The files CHOOSE, CLEAR, ECHO, LOAD, MOVE, SKIP are DOS device
drivers, even though their names do not end with SYS. You may rename
these files with a SYS extension as long as you also use the extension
in the CONFIG.SYS file. Device drivers are only 'run' via the
CONFIG.SYS file. The files INPUT.COM and MOOT.COM are executable
programs that are usually run from batch files.
If you do not place the device drivers in the root directory, you will
need to specify a path in the DEVICE= statement. You may also need to
specify path when running the programs INPUT.COM and MOOT.COM.
All of the device drivers, except CHOOSE, automatically remove
themselves from memory once they have executed. CHOOSE can be
configured to remain resident or remove itself from memory. When
CHOOSE remains in memory, MOOT.COM can retrieve the configuration
selection.
The string arguments for the device drivers consist of sequences of
characters enclosed by double-quote characters ("). Special back-
slash codes may be used within strings:
\" double quote character
\a sound speaker (audible)
\f clear screen and move cursor to upper left (formfeed)
\n carriage return / linefeed (newline)
Note that DOS usually converts the CONFIG.SYS file into uppercase
when it is loaded, thus all letters in strings will be in uppercase.
The keystroke arguments for CHOOSE and INPUT.COM consist of an ASCII
code for standard keys and a negative scan code for special keys. The
codes for some commonly used keys are:
Backspace 8
Tab 9
Enter 13
Escape 27
0 to 9 48 to 57
a to z 97 to 122
A to Z 65 to 90
Ctrl-A to Ctrl-Z 1 to 26
Left -75
Right -77
Up -72
Down -80
Page Up -73
Page Down -81
Home -71
End -79
Insert -82
Delete -83
F1 to F10 -59 to -68
The keystrokes for the device drivers are case-insensitive. The
keystrokes for INPUT.COM are case-insensitive only when the /U option
is used.
The color argument for CLEAR is a standard attribute byte. An
attribute byte consists of a color value (the foreground) plus a color
value times 16 (the background). Adding 8 to the attribute makes the
foreground color brighter and adding 128 to the attribute makes the
foreground blink. The color values are:
Black 0
Blue 1
Green 2
Cyan 3
Red 4
Magenta 5
Brown 6
White 7
Example: the attribute for bright white on blue is (Blue * 16) + White
+ 8 = (1 * 16) + 7 + 8 = 31.
The programs INPUT.COM and MOOT.COM return an error code based on user
input and the CHOOSE selection. This error code is accessed in a
batch file using the IF ERRORLEVEL batch command.
The Moot Utilities have only been tested on PC DOS 3.2, MS DOS 4.01,
and PC DOS 4.01. Before changing the CONFIG.SYS and AUTOEXEC.BAT
files on your hard disk, you should create a boot floppy from which to
test the Moot Utilities and make sure they work properly on your
system.
What follows is a a description of each of the device drivers and
programs. At the end of this document are example CONFIG.SYS files
and batch files using the Moot Utilities.
CHOOSE
------
The CHOOSE device driver allows you to dynamically select one of up to
nine different blocks of lines in the CONFIG.SYS file to be processed.
When CHOOSE is executed, the user will be prompted for the
configuration to use. The CONFIG.SYS file may contain multiple CHOOSE
statements, as long as the blocks are not overlapped or nested. The
syntax for CHOOSE is:
DEVICE=CHOOSE [prompt] [time] [default] [0]
DEVICE=#1 [prompt] key
:
<normal CONFIG.SYS statements>
:
DEVICE=#2 [prompt] key
:
<normal CONFIG.SYS statements>
:
DEVICE=#END [prompt]
-----
prompt A string to display.
time The number of seconds to wait for a response from the user.
If the user does not respond, the default configuration
block is used. If no time is specified, CHOOSE will wait
indefinitely.
default The default configuration block number to use if no key is
pressed. This value must be in the range 1 to 9 (it is not
range checked). If no default is specified, the first
block will be selected.
0 If zero is specified on the CHOOSE line, the resident
kernel of CHOOSE will not be loaded. Use this option if
you do not need MOOT.COM to check the configuration or you
use multiple CHOOSE commands.
key The keystroke that selects this block.
When a choice is made, by keystroke or default, one (and only one) of
the configuration statement blocks delimited by the #1, #2, ..., #9,
or #END device statements will be loaded.
Note: the device names #1 through #9 and #END are only used to delimit
blocks of statements. If CHOOSE works properly, the operating system
will not attempt to load these statements as devices. The character
sequences #1, #2, #3, #4, #5, #6, #7, #8, #9, and #END can only be
used as part of a CHOOSE.
All the prompts are optional. If a prompt is specified with the #END
statement, the keystroke will be echoed, otherwise the keystroke will
not be echoed.
CHOOSE remains resident by default. If zero is specified on the
command line, CHOOSE will not remain resident. If CHOOSE remains
resident, MOOT will return the selection number. If multiple CHOOSE's
are resident, MOOT will return the selection number of the last CHOOSE
loaded. CHOOSE uses less than 150 bytes of memory when resident.
The CHOOSE driver may crash if a default value is greater than 9 or
there is no #END statement.
CLEAR
-----
The CLEAR device clears the screen. The syntax for CLEAR is:
DEVICE=CLEAR [color]
-----
color An attribute byte.
If no color is specified, the attribute at the cursor location is used.
ECHO
----
The ECHO device displays a string. The syntax for ECHO is:
DEVICE=ECHO string
-----
string The string to display.
INPUT.COM
---------
This program waits for specific keystrokes and returns an error code
based on the keystroke. Batch files can use this code to branch for
specific input. The syntax for INPUT.COM is:
INPUT [/U] [/E] [/Tn] [/Dn] n[, n, ...]
-----
/E Echo the keystroke.
/U Convert all ASCII codes to uppercase. This option makes the
input case-insensitive.
/Fn Display the file n before input. This option lets you set up
the screen before performing the input. If you have ANSI.SYS
loaded, you can clear the screen and position the cursor using
ANSI sequences imbedded in the file.
/Tn Wait n seconds for response. If no response if given, the
default (/D) value is returned. If this option is not
specified, INPUT.COM waits indefinitely for input.
/Dn Return code n if timeout. If this option is not specified,
INPUT.COM will return 0. This option is only meaningful when
the /T option is used.
n A keystroke to wait for. Multiple keystrokes may be specified
and at least one keystroke is required. The error code returned
is based on the position of the keystroke on the command line.
The first keystroke returns error code 1, the second returns
error code 2, etc.
LOAD
----
The LOAD device lets you selectively load or ignore the next line in
the CONFIG.SYS file. When LOAD is executed, you are prompted as to
whether or not you wish to load the next line. The syntax for LOAD
is:
DEVICE=LOAD prompt [time]
-----
prompt The prompt to display. A " (Y/N)? " is automatically
appended to the string.
time The number of seconds to wait for a response from the user.
If the user does not respond, the next CONFIG.SYS line will
not be loaded. If no time is specified, LOAD will wait
indefinitely.
MOOT.COM
--------
This program returns the selection number (1 to 9) from the CHOOSE
driver. Batch files can use this code to branch for specific CHOOSE
configurations. A code of 0 is returned if the CHOOSE driver isn't
installed and a code of 255 if CHOOSE is installed but detected an
installation error. The syntax for MOOT.COM is:
MOOT
MOVE
----
The MOVE device positions the cursor, presumably before something is
displayed. The syntax for MOVE is:
DEVICE=MOVE row column
-----
row is the screen row
column is the screen column
SKIP
----
The LOAD device lets you selectively skip or load the next line in the
CONFIG.SYS file. When SKIP is executed, you are prompted as to
whether or not you wish to skip the next line. The syntax for SKIP
is:
DEVICE=SKIP prompt [time]
-----
prompt The prompt to display. A " (Y/N)? " is automatically
appended to the string.
time The number of seconds to wait for a response from the user.
If the user does not respond, the next CONFIG.SYS line is
will not be skipped. If no time is specified, SKIP will
wait indefinitely.
Examples
--------
Here are example CONFIG.SYS and AUTOEXEC.BAT files, which are similar
to the actual files I use on my system. Note that the Moot files are
stored in a directory called BOOT on drive C:.
This CONFIG.SYS has three basic configurations: standard, minimum, and
debugging. The configuration is selected by pressing a number one,
two, or three. The standard configuration is used most of the time
and is selected by default after four seconds. The minimum
configuration loads as little as possible for high memory requirement
applications. The debugging configuration forces my disk cache
(NCACHE-S) to leave 640K of extended memory available so I can perform
virtual debugging with Turbo Debugger. The standard configuration
also allows me to optionally load the device driver TDH386.SYS.
CONFIG.SYS
----------
device=c:\boot\CHOOSE "\f+--------------+" 4
device=#1 "| 1. STANDARD |" 49
buffers=7
stacks=8,64
device=c:\os\ramdrive.sys 566 512 32 /e
device=c:\os\himem.sys
device=C:\boot\LOAD "LOAD TD386" 3
device=c:\td\tdh386.sys
device=c:\nu\ncache-s.exe /-w a: -a b: -a
device=#2 "| 2. MINIMUM |" 50
buffers=10
stacks=0,0
lastdrive=f
device=#3 "| 3. DEBUGGING |\n+--------------+" 51
buffers=7
stacks=8,64
device=c:\os\ramdrive.sys 557 512 32 /e
device=c:\td\tdh386.sys
device=c:\nu\ncache-s.exe /ext=-640 /-w a: -a b: -a
device=#END
This AUTOEXEC.BAT reflects the three main configurations stored in the
CONFIG.SYS file. The first action performed is to run MOOT.COM to
retrieve the configuration selection. The standard and debugging
configurations jump to the same locations. My menu system is started
by running C:\BAT\M, and at the end of this file, a prompt is
displayed and if <ESC> is pressed in four seconds, my menu system is
skipped. If <SPACE> or <ENTER> is pressed, the menu system is entered
immediately. INPUT.COM is used to enter or skip the menu system. The
prompt displayed by INPUT.COM is stored in the file MENU.TXT.
AUTOEXEC.BAT
------------
c:\boot\moot
IF ERRORLEVEL 3 GOTO standard
IF ERRORLEVEL 2 GOTO minimum
IF ERRORLEVEL 1 GOTO standard
:standard
c:\boot\mouse
GOTO done
:minimum
c:\os\subst f: c:\trash
GOTO done
:done
set nu=c:\nu
CALL c:\bat\normal
c:\boot\input /fc:\boot\menu.txt /t4 32 13 27
IF ERRORLEVEL 3 GOTO skip
c:\bat\m
:skip
c:
cls